package dryven.codegen.asm;

import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;

import dryven.codegen.asm.typeinfo.TypeInfo;

public class StackMapFrame {
	
	private List<TypeInfo> _operandStackTypes = new LinkedList<TypeInfo>();
	private List<TypeInfo> _localVarTypes = new LinkedList<TypeInfo>();
	private MethodBuilder _builder;
	
	public StackMapFrame(List<TempValue> operandStack, List<LocalVariable> localVars, MethodBuilder builder) {
		for (LocalVariable localVariable : localVars) {
			_localVarTypes.add(localVariable.getTypeInfo());
		}
		for (TempValue tv : operandStack) {
			_operandStackTypes.add(tv.getTypeInfo());
		}
		_builder = builder;
	}
	
	public void visit() {
		
	}
	
	public void print() {
		System.out.println("Stack map frame:");
		if(_operandStackTypes.size()==0) {
			System.out.println("no frames");
			return;
		}
		for (TypeInfo ti : _operandStackTypes) {
			System.out.println(" - " + ti.getTypeName());
		}
	}
}
